package gdut.imis.controller;

import gdut.imis.Utils.Result;
import gdut.imis.domain.MatchesTeam;
import gdut.imis.service.MatchesTeamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author JiaFu
 * @Date 2023/4/8 18:53
 */
@RestController
@RequestMapping("/matches-team")
@Api(value = "队伍与比赛关联接口", tags = {"队伍与比赛关联接口"})
@RequiredArgsConstructor
public class MatchesTeamController extends BaseController {
    private final MatchesTeamService matchesTeamService;

    @ApiOperation("新增队伍与比赛关联")
    @PostMapping("/addTeams")
    @PreAuthorize("@cp.hasPermission('matchesTeam')")
    public Result addTeams(@RequestBody MatchesTeam matchesTeam) {
        return matchesTeamService.addTeams(matchesTeam);
    }

}
